


def my_route(app=None, rule='', **options):

    def decorator(f):
        if 'endpoint' in options:
            endpoint = options['endpoint']
        else:
            endpoint = f.__name__
            options['endpoint'] = endpoint

        app.add_url_rule(rule, endpoint, f)

        return f

    return decorator